﻿@Html.Label("Person search")
@Html.JQueryUI().Autocomplete("PersonAutocomplete", Url.Action("GetPersons", "Menu"), null, "PersonSearch", null, null).MinLength(2).OnSelect("selectedPersonId.onSelect").Delay(250).AutoFocus(true)

<script type="text/javascript">
    var selectedPersonId = {};

    selectedPersonId.onSelect = function (event, ui)
    {
        window.location.href = '@Url.Action("Index", "Person")' + '?PersonId=' + ui.item.value;
    }
</script>